<%@ page contentType="text/html; charset=utf-8" language="java" import="com.davinci.freemarket.dataModelLayer.model.CategoriasModel, java.util.ArrayList,com.davinci.freemarket.businessLayer.controllers.CategoriasController,java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--[if IE]><![endif]-->
<!--[if lt IE 7 ]> <html lang="es" class="no-js ie6"> <![endif]--> 
<!--[if IE 7 ]>    <html lang="es" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="es" class="no-js ie8"> <![endif]--> 
<!--[if IE 9 ]>    <html lang="es" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="es" class="no-js"> <!--<![endif]-->
<head>
<!-- Avoid script blocking -->
	<script></script>
	<meta charset="utf-8">
<title>Free Market - Sitio gratuito de comercio electrónico</title>
	<!-- Chico-UI Core Style Sheet -->
	<link rel="stylesheet" href="./src/ml/css/chico-min-0.9.1.css"/>
		<link rel="stylesheet" href="./src/ml/css/chico-mesh.css"/>
	
	<!--[if lt IE 7 ]>
		<script src="./libs/js/dd_belatedpng.js"></script>
		<script> DD_belatedPNG.fix('img, .ico'); //fix any <img> or .ico background-images </script>
	<![endif]--> 
</head>
<body>
<div class="ch-g1">
    <div class="box">
    	<img src="./Ecommerce-logo.png" alt="Free Market" />
        <form method="get" action="servlet/BrowserServlet" id="browser">
			<div class="autoComplete" id="a">
				<input type="text" id="autocomplete" name="search" placeholder="¿Qué estás buscando?" />
			</div>
			<div id="b">
				<input type="submit" class="ch-btn ch-secondary" value="Buscar"/>
			</div>
	 	</form>
		<a href="RegisterPage.jsp" id="register" class="YOUR_SELECTOR_Modal">Registrarse </a>|
        <a href="login.jsp" id="login" class="YOUR_SELECTOR_Modal"> Ingresar</a>
        <form method="get" action="servlet/PublisherServlet" id="publish">
        	<p><input type="submit" class="ch-btn ch-secondary" value="Publicar"/></p>
        </form>
    </div>
</div>
<div class="ch-g1">
   <div class="ch-g1-4">
        <div class="box leftcolumn">
            <h2>Categorías</h2>
            <%
            	CategoriasController categoController = new CategoriasController();
            ArrayList<CategoriasModel> categories = categoController.listCategorias(); 
            for(CategoriasModel category : categories){%>
            	<p><a href="servlet/GetPublicationServlet?publish_identifier=<%out.println(category.getName());%>"><%out.println(category.getName()); %></a></p>
            <%}%>
            
            
        </div>
    </div>
    <div class="ch-g3-4">
        <div class="box rightcolumn">

	<div id="loginsection">
		<h2>Registración de usuario</h2>
		<form action="servlet/RegisterServlet" method="post" class="ch-form">
		<fieldset>
		<p class="ch-form-hint">* Campos requeridos</p>
			<p class="ch-form-row ch-form-required"> 
						<label for="nick">
							Usuario: <em>*</em>
						</label>													
						<input type="text" id="characters" name="nick" size="30" placeholder="" required="required"/>
						<span class="ch-form-hint">Será tu nombre para iniciar sesión</span> 
					</p>
			<p class="ch-form-row ch-form-required"> 
						<label for="pass">
							Password: <em>*</em>
						</label>													
					 	<input type="password" id="characters" name="password" size="30" placeholder="" required="required"/> 
					</p>
			<p class="ch-form-row ch-form-required"> 
						<label for="email">
							Email: <em>*</em>
						</label>													
						<input type="text" id="characters" name="email" size="30" placeholder="usuario@dominio.com" required="required"/> 
					</p>
			<p class="ch-form-row"> 
						<label for="address">
							Dirección: 
						</label>													
						<input type="text" id="characters" name="address" size="30" placeholder="Av. Corrientes 2546 5to A"/>
					</p>	
			<p class="ch-form-row"> 
						<label for="name">
							Nombre: 
						</label>													
						<input type="text" id="characters" name="name" size="30" placeholder=""/>
					</p>
				<p class="ch-form-row"> 
						<label for="lastname">
							Apellido: 
						</label>													
						<input type="text" id="characters" name="lastname" size="30" placeholder=""/>
					</p>
				<p class="ch-form-row"> 
						<label for="phone">
							Teléfono: 
						</label>													
						<input type="text" id="characters" name="phone" size="30" placeholder=""/>
					</p>			
		</fieldset>		
					<input type="submit" value="registrar" class="ch-btn ch-primary lean"/>
		</form>	
	

</div>
        </div>
    </div>
</div>
<div class="ch-g1">
    <div class="box">         
  <p align="center">El uso de este sitio web implica la aceptación de los Términos y   Condiciones</a> y de las Políticas de   Privacidad</a> de Free Market S.A</p>
  <p align="center"	>Copyright © 2010-2011 Free Market S.A.</p>
    </div>
</div>
	<script src="http://code.jquery.com/jquery-1.7.js"></script>
	<script src="src/js/chico-0.9.1.js?debug=true"></script>
	<script src="./src/plugins/gallery/chico.gallery.js"></script>
</body>
</html>
